﻿using System.Linq;
using System.Xml.Linq;
using NUnit.Framework;
using OpenWaves.EPiServer.Localization.Model;
using OpenWaves.EPiServer.Localization.UnitTests.Resources.LanguageFiles;

namespace OpenWaves.EPiServer.Localization.UnitTests
{
    [TestFixture]
    public class TranslationModelTests
    {
        [Test]
        public void TestBuildingSimpleModel()
        {
            var document= XDocument.Parse(TestResources.Channels);
            TranslationModel translationModel = new TranslationModel(document);

            Assert.AreEqual(2, translationModel.Entries.Count);

            var channelsEntry = translationModel.Entries[0];
            Assert.AreEqual("ChannelsKeys", channelsEntry.GetClassName());

            Assert.AreEqual(2, channelsEntry.Entries.Count);
            var mobileEntry = channelsEntry.Entries[0];
            Assert.AreEqual("Mobile", mobileEntry.GetPropertyName());

            
        }
    }
}